<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <link rel="icon" type="image/png" href="/assets/image/favicon.png">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>普特跨境电商平台-后台登录</title>
    <style>
        *{
            font-family: 微软雅黑 !important;
            outline:none;
        }
        html,body{
            width:100%;
            height:100%;
            margin:0px;
            padding:0px;
        }
        .login{
            height:100%;
            background-image: url("/assets/image/login_image_bg.png");
            background-size: cover;
            background-position:center center;
        }
        .login .content{
            position: absolute;
            width:400px;
            margin-top:-200px;
            margin-left:-200px;
            top:50%;
            left:50%;
        }
        .login .content h2{
            text-align:center;
            color:#fff;
        }
        .login .content .form{
            width:300px;
            padding:50px;
            border-radius:5px;
            background-color: rgba(0,0,0,0.4);
            color:#fff;
        }
        .login .content .form label{
            display:block;
            margin-bottom:10px;
        }
        .login .content .form input{
            width:290px;
            padding:0 5px;
            border-width:0px;
            border-radius:3px;
            background-color:rgba(0,0,0,0.65);
            line-height:40px;
            color:#eee;
            margin-bottom:20px;
        }
        .login .content .form button{
            margin-top:20px;
            border-width:0px;
            background-color:#6F6FFF;
            width:300px;
            line-height:40px;
            border-radius:3px;
            color:#eee;
            font-size:16px;
        }
        .login .content .form button:active{
            -moz-box-shadow: 1px 1px 2px 2px #5555CE inset; /* 老的 Firefox */
            box-shadow: 1px 1px 2px 2px #5555CE inset;
        }
    </style>
</head>
<body>
    <div class="login">
        <div class="content">
            <h2>普特跨境电商平台-后台登录</h2>
            <div class="form">
                <form action="" id="form">
                    <div class="">
                        <label for="username">账号：</label>
                        {!! csrf_field() !!}
                        <input type="text" id="username" name="username" placeholder="">
                    </div>
                    <div class="">
                        <label for="password">密码：</label>
                        <input type="text" id="password" name="password" placeholder="" onfocus="$(this).attr('type','password')">
                    </div>
                    <div class="">
                        <button class="submit" type="submit">登录</button>
                    </div>
                </form>
            </div>
        </div>
    </div>

    <script src="/assets/js/jquery-3.1.1.min.js"></script>
    <script src="/assets/layer/layer.js"></script>
    <script>
        $(function(){
            $("#form").submit(function(){
                $.post("{{url('/admin/index/login')}}",$("#form").serialize(),function (data) {
                    if(data['status'] == "200"){
                        layer.msg(data['text'], {time: 1000}, function(){
                            window.location.href = "{{url('/admin/center/center')}}";
                        });
                    }else{
                        layer.msg(data['text']);
                    }
                });
                return false;
            });
        });

    </script>
</body>
</html>